package com.museum.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.museum.entity.DO.ColProcess;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yznl
 * @since 2021-01-17
 */
@Repository
@Mapper
public interface ProcessMapper extends BaseMapper<ColProcess> {
    @Update("update  col_process set operate_status = #{status} where id = #{id};")
    int commitCol(Integer id,Integer status);

    @Update("update col_process set operate_desc = #{operate_desc} where id = #{id}")
    void updateOperateDesc(String operate_desc,Integer id);
    @Select("select count(*) from col_process where operate_status = 0 and id = #{clueId}")
    boolean isOperateStauts(int clueId);
    @Select("select count(*) from col_process where operate_status = 1 and id = #{clueId}")
    boolean isOperateStauts2(int clueId);
    @Update(" update col_process set price_status = #{status} where id = #{id}")
    int commitColPrice(Integer id, Integer status);
    @Select("select status from col_process where id = #{clueId}")
    Integer getStatus(int clueId);
    @Select("select count(*) from col_process where price_status = 1 and id = #{clueId}")
    boolean isPriceStauts(int clueId);
    @Update(" update col_process set collection_status = #{status} where id = #{id}")
    int commitCollection(Integer id, Integer status);
    @Select("select count(*) from col_process where price_status = 0 and id = #{clueId}")
    boolean isPriceNotStauts(int clueId);
    @Select("select count(*) from col_process where collection_status = 0 and id = #{clueId}")
    boolean isColNotStauts(int clueId);
    List<Integer> getPageIds(HashMap<String, Object> map);
}
